// 获取banner数据

import { ref, onMounted } from "vue";
import { getBanner } from "@/apis/home";

export function useBanner(distributionSite = 1) {
    const bannerList = ref([]);
    // 请求赋值
    const getBannerList = async () => {
        const res = await getBanner({ distributionSite });
        bannerList.value = res.result;
    };

    onMounted(() => getBannerList());

    return {
        bannerList,
        getBannerList,
    };
}
